package cn.fxl.hystrix;

import cn.fxl.ajax.AjaxResult;
import cn.fxl.domain.User;
import cn.fxl.feign.UserFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserHystrix implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public AjaxResult buyticket(User user) {
                return new AjaxResult(false,"熔断");
            }
        };
    }
}
